package com.addcn.pushlibrary.vivo
import android.app.ActivityManager
import android.app.Application
import android.content.Context
import android.util.Log
import com.addcn.pushlibrary.LConfiguration
import com.heytap.msp.push.HeytapPushManager
import com.heytap.msp.push.callback.ICallBackResultService
import com.vivo.push.PushClient
import com.xiaomi.mipush.sdk.MiPushClient


/**
 * author:luwenbo
 * created on date : 2019-06-06
 * content:
 * describe:
 */

class LVivoManger{
    companion object{
        var TAG = "LVivoManger"
        fun init(application: Application, configuration: LConfiguration?) {
            PushClient.getInstance(application.applicationContext).initialize()
            PushClient.getInstance(application).turnOffPush {
                Log.d(TAG,"==it:$it")
            }
            
        }


        fun isSupport(context: Context):Boolean?{
            return PushClient.getInstance(context).isSupport
        }
        
        fun startPush(context: Context) {
            PushClient.getInstance(context).turnOffPush {

            }
        }

        fun stopPush(context: Context) {
            PushClient.getInstance(context).turnOnPush {

            }
        }

        fun setTag(context: Context){
            MiPushClient.setAlias(context,null,"")
        }


        fun unRegister(){
            //MiPushClient.registerToken()
        }

        fun getRegisterId(context: Context):String{
            if (PushClient.getInstance(context).regId == null){
                return ""
            }
           return PushClient.getInstance(context).regId
        }

    }

}